---
title: "Add"
"og:title": "dub.domains.add - Add a domain - TypeScript SDK"
description: "Add a domain to the authenticated workspace."
---

import DomainResponse from "/snippets/domain-response.mdx";

## Arguments

<ParamField body="slug" type="string" required>
  Name of the domain. Eg. `acme.com`.
</ParamField>

<ParamField body="type" type="enum<string>" default="redirect">
  The type of redirect to use for this domain.
  <enum>
    <value>redirect</value>
    <value>rewrite</value>
  </enum>
</ParamField>

<ParamField body="target" type="string | null">
  The page your users will get redirected to when they visit your domain.
</ParamField>

<ParamField body="expiredUrl" type="string | null">
  Redirect users to a specific URL when any link under this domain has expired.
</ParamField>

<ParamField body="archived" type="boolean" default={false}>
  Whether to archive this domain. false will unarchive a previously archived
  domain.
</ParamField>

<ParamField
  body="placeholder"
  type="string | null"
  default="https://dub.co/help/article/what-is-dub"
>
  Provide context to your teammates in the link creation modal by showing them
  an example of a link to be shortened.
</ParamField>

## Response

<DomainResponse />

<RequestExample>

```ts
await dub.domains.add({
  slug: "acme.com",
});
```

</RequestExample>

<ResponseExample>

```ts
{
  id: "clvcep2sn87jh8nf808x00005",
  slug: "acme.com",
  verified: false,
  primary: true,
  archived: false,
  placeholder: "https://dub.co/help/article/what-is-dub",
  expiredUrl: null,
  target: null,
  type: "redirect",
  clicks: 0
}
```

</ResponseExample>
